package com.chinasoft.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
public class UserController {

    //  http://localhost/showPage
    @RequestMapping("/showPage")
    public String showPage(){
        System.out.println("user mvc controller is running ... ");
        return "page.jsp";
    }
    // 请求转发 forward:   支持访问 WEB-INF
    @RequestMapping("/showPage1")
    public String showPage1(){
        System.out.println("user mvc controller is running ... ");
        return "forward:/WEB-INF/page/page.jsp";
    }

    //  相应重定向redirect    不支持访问 WEB-INF
    @RequestMapping("/showPage2")
    public String showPage2(){
        System.out.println("user mvc controller is running ... ");
        // return "redirect:/WEB-INF/page/page.jsp";
        return "redirect:/page.jsp";
    }
    /**
     *         <property name="prefix" value="/WEB-INF/page/"/>
     *         <property name="suffix" value=".jsp"/>
     */

    @RequestMapping("/showPage3")
    public String showPage3(){
        System.out.println("user mvc controller is running ... ");
        //  /WEB-INF/page/page.jsp
        return "page";
    }

}